package com.hzj.springcloud.controller;

import com.hzj.springcloud.pojo.Dept;
import com.hzj.springcloud.service.DeptClientService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;


@Controller
@RestController
public class DeptConsumerController {

    @Autowired
    DeptClientService dcs;//注入service接口

//    @GetMapping("consumer/dept/get/{id}")
//    public Dept getDeptById(@PathVariable("id") int id) {
//
//        return dept;
//    }
//
//    @PostMapping("consumer/dept/add")
//    public int getDeptById(Dept dept) {
//
//        return integer;
//    }

    @RequestMapping("/consumer/dept/list")
    public List<Dept> show() {
        List<Dept> list = dcs.show();
        return list;
    }
    @RequestMapping("/")
    public String getStr(){
        return "1";
    }
}
